package com.git.dengchongshuang.managementsystem.Test;

import com.git.dengchongshuang.managementsystem.Contact;
import com.git.dengchongshuang.managementsystem.OperateContacts;

import java.util.Arrays;
import java.util.List;

/**
 * @author DCSGO
 * @version 1.0
 */
public class OperateContactsTest {
    public static void main(String[] args) {
        Contact c1 = new Contact("王", "110");
        Contact c2 = new Contact("刘", "120");
        Contact c3 = new Contact("b", "119");
//        添加联系人
//        OperateContacts.add(c1);
//        OperateContacts.add(c2);
//        OperateContacts.add(c3);
//        System.out.println(Arrays.toString(OperateContacts.getAllContact().toArray()));
////        删除联系人
//        OperateContacts.remove(c1);
//        System.out.println(Arrays.toString(OperateContacts.getAllContact().toArray()));
////        根据名字获取
//        System.out.println(OperateContacts.getContactByName("刘"));
////        根据电话获取
//        System.out.println(Arrays.toString(OperateContacts.getAllContact().toArray()));
//        //System.out.println(OperateContacts.getContactByPhoneNumber("120"));
////        更新数据
//        Contact c4 = new Contact("a","133");
//        OperateContacts.updateContactByNameAndPhoneNumber("刘","120",c4);
//        System.out.println(Arrays.toString(OperateContacts.getAllContact().toArray()));
////        按照名字排序 升序
//        List<Contact> contactList = OperateContacts.getAllContactOrderByName();
//        System.out.println(Arrays.toString(contactList.toArray()));
////        按照电话排序 升序
//        List<Contact> contactLists = OperateContacts.getAllContactOrderByPhoneNumber();
//        System.out.println(Arrays.toString(contactLists.toArray()));
    }
}
